package com.flycent.fanbao.ui;

import net.tsz.afinal.FinalActivity;
import net.tsz.afinal.annotation.view.ViewInject;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.flycent.fanbao.App;
import com.flycent.fanbao.R;

public class FictionActivity extends BackableTitleBarActivity{
	@ViewInject(id = R.id.data_group_lin ) LinearLayout mGrouoLin;
	@ViewInject(id = R.id.showbut ,click = "onClick") Button mShowBut;

	@Override
	protected void onCreate(Bundle savedInstance) {
		super.onCreate(savedInstance);
		setContentView(R.layout.activity_fiction);
		FinalActivity.initInjectedView(this);
		getTitleBar().setTitle("数据");

		mGrouoLin.removeAllViews();
		for (int i = 0; i < 3; i++) {
			LinearLayout convertView =  (LinearLayout) LayoutInflater.from(FictionActivity.this).inflate(R.layout.item_relat_datail, null);
			TextView text1 = (TextView) convertView.findViewById(R.id.data_text1);
			EditText text2 = (EditText) convertView.findViewById(R.id.data_text2);

			text1.setText("cons"+i);
			text2.setText("ecds"+i);

			mGrouoLin.addView(convertView);	
		}		

	}

	public void onClick(View v){

		if(v == mShowBut){
			for (int i = 0; i < mGrouoLin.getChildCount(); i++) {
				TextView text1 = (TextView) mGrouoLin.getChildAt(i).findViewById(R.id.data_text1);
				TextView text2 = (TextView) mGrouoLin.getChildAt(i).findViewById(R.id.data_text2);
				App.showLog("aa=="+getText(text1));
				App.showLog("bb=="+getText(text2));
			}
		}
	}


}
